package cn.qn.enums;

/**
 * 文章多媒体文件类型
 */
public enum ArticleMediaTypeEnum {

    NONE("0", "暂无"),
    IMAGE("1", "图片"),
    VIDEO("2", "视频");

    private String code;

    private String desc;

    private ArticleMediaTypeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static String getDesc(String code) {
        for (ArticleMediaTypeEnum enums : ArticleMediaTypeEnum.values()) {
            if (enums.getCode().equals(code)) {
                return enums.getDesc();
            }
        }
        return "其他";
    }
}
